package s2elinshu;

public class J05Ex33Patterns {
	public static void main(String[] args) {
		// Pattern 1
		int odd = 1;
		int noOfSpaces = 3;
		for (int i = 1; i <= 7; i++) {
			for (int j = noOfSpaces; j >= 1; j--) {
				System.out.print(" ");
			}
			for (int j = 1; j <= odd; j++) {
				System.out.print("+");
			}
			System.out.println();
			if (i < 4) {
				odd = odd + 2;
				noOfSpaces = noOfSpaces - 1;
			} else {
				odd = odd - 2;
				noOfSpaces = noOfSpaces + 1;
			}
		}

		// Pattern 2
		int n = 1;
		for (int i = 1; i <= 7; i++) {
			for (int j = 1; j <= n; j++) {
				System.out.print("+");
			}
			System.out.println();
			if (i < 4) {
				n = n + 2;
			} else {
				n = n - 2;
			}
		}

		// pattern 3
		odd = 1;
		noOfSpaces = 7;
		for (int i = 1; i <= 7; i++) {
			for (int j = noOfSpaces; j >= 1; j--) {
				System.out.print(" ");
			}
			for (int j = 1; j <= odd; j++) {
				System.out.print("+");
			}
			System.out.println();
			if (i < 4) {
				odd = odd + 2;
				} 
			else {
				odd = odd - 2;
			}
		}

	}
}